<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function getArrMax(arr) { //arr接收一个数组
            var max = arr[0];
            for (var i = 1; i <= arr.length; i++) {
                if (arr[i] > max) {
                    max = arr[i];
                }
            }
            return max;
        }
        // getArrMax([5, 2, 99, 101, 67, 77]); //实参是一个数组送过去
        // console.log(getArrMax([5, 2, 99, 101, 67, 77]));
        //实际开发中：
        var re = getArrMax([5, 2, 99, 101, 67, 77]);
        console.log(re); //通过引入一个变量实现
    </script>
</head>

<body>

</body>

</html>